/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.equipment.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.thinkgem.jeesite.common.persistence.DataEntity;
import com.thinkgem.jeesite.common.utils.StringUtils;
import com.thinkgem.jeesite.modules.sys.entity.Office;
import org.hibernate.validator.constraints.Length;

import java.util.Date;

/**
 * 设备管理Entity
 * @author ZC
 * @version 2017-04-18
 */
public class EleEquipment extends DataEntity<EleEquipment> {
	
	private static final long serialVersionUID = 1L;
	private EleEquipmentType type;		// 设备类型
	private Office company;	// 归属公司
	private Office office;	// 归属分组
	private String code;		// 设备Id
    private int width;		// 分辨率
    private int height;		// 视频音量
	private int audiovolume = 80;		// 报站音量
	private int videovolume = 50;		// 视频音量
	private String ipaddress;		// ip地址
	private String ipmode;		// 获取IP
	private int backlight = 80;		// 亮度
	private int sleeplightlevel1 = 15;		// 一级休眠亮度
	private int hangupthreshold1 = 90;		// 一级休眠时间
	private int sleeplightlevel2 = 0;		// 二级休眠亮度
	private int hangupthreshold2 = 1200;		// 二级休眠时间
	private int personlimit =13;		// 载人
	private int kglimit = 1050;		// 载重KG
	private String timezone="UTC+08";		// 时区
	private String language = "1";		// 语言
	private String orientation;		// 方向
	private String floorMapping;		// 楼层映射
	private String address; // 位置/项目

	private String serverIpaddress; // 服务器地址
	private String serverPort; // 服务器端口
	private String wifiName; // WIFI热点名称
	private String wifiPassword; // WIFI连接密码

	private String mv;
	private String pv;
	private String sv;

	private int fullscreen;// 是否全屏	0：非全屏，1：全屏
	private int titledisplay;// 标题显隐	0：隐藏，1：显示
	private int timedisplay;// 时间、日期显隐	0：隐藏，1：显示
	private int subtitledisplay;// 滚动文字显隐	0：隐藏，1：显示
	private int imageinterval;// 图片间隔	秒1-300
	private String dateformat;// 日期格式	MM.dd.yyyy、MM-dd-yyyy、MM/dd/yyyy、yyyy-MM-dd、yyyy.MM.dd、yyyy/MM/dd、MM.dd.yy、MM-dd-yy、MM/dd/yy、yy-MM-dd、yy.MM.dd、yy/MM/dd
	private String timeformat;// 时间格式	12、24
	private String isPublish;		// is_publish
	private String state;
	private Date stateDate;	// 在线状态更新日期
	private String name;
	private Floor floor;		// 楼层映射

	private String show;
	private String set;
	private String mcu;
	
	private String devicetime;
	
	private String delApply; // 是否删除审请记录
	private String delApproval; // 是否删除审核记录

	private String comment;		// 驳回原因

	public EleEquipment() {
		super();
	}

	public EleEquipment(String id){
		super(id);
	}

	public EleEquipmentType getType() {
		return type;
	}

	public void setType(EleEquipmentType type) {
		this.type = type;
	}

	public int getAudiovolume() {
		return audiovolume;
	}

	public void setAudiovolume(int audiovolume) {
		this.audiovolume = audiovolume;
	}

	public int getVideovolume() {
		return videovolume;
	}

	public void setVideovolume(int videovolume) {
		this.videovolume = videovolume;
	}
	
	public String getIpaddress() {
		return ipaddress;
	}

	public void setIpaddress(String ipaddress) {
		this.ipaddress = ipaddress;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getIpmode() {
		return ipmode;
	}

	public void setIpmode(String ipmode) {
		this.ipmode = ipmode;
	}
	

	public int getBacklight() {
		return backlight;
	}

	public void setBacklight(int backlight) {
		this.backlight = backlight;
	}


	public int getPersonlimit() {
		return personlimit;
	}

	public void setPersonlimit(int personlimit) {
		this.personlimit = personlimit;
	}

	public int getKglimit() {
		return kglimit;
	}

	public void setKglimit(int kglimit) {
		this.kglimit = kglimit;
	}

	public String getTimezone() {
		return timezone;
	}

	public void setTimezone(String timezone) {
		this.timezone = timezone;
	}
	
	public String getLanguage() {
		return language;
	}

	public void setLanguage(String language) {
		this.language = language;
	}
	
	public String getOrientation() {
		return orientation;
	}

	public void setOrientation(String orientation) {
		this.orientation = orientation;
	}

	@JsonIgnore
	@Length(min=0, max=100, message="楼层映射长度必须介于 0 和 100 之间")
	public String getFloorMapping() {
		return floorMapping;
	}

	public void setFloorMapping(String floorMapping) {
		this.floorMapping = floorMapping;
	}

	public String getAddress(){
		return address;
	}

	public void setAddress(String address){
		this.address = address;
	}

    @JsonIgnore
	public Office getCompany(){
		return company;
	}

	public void setCompany(Office company){
		this.company = company;
	}

    @JsonIgnore
	public Office getOffice(){
		return office;
	}

	public void setOffice(Office office){
		this.office = office;
	}

	public String getCode(){
		return code;
	}

	public void setCode(String code){
		this.code = code;
	}

    @JsonIgnore
    public int getWidth(){
        return width;
    }

    public void setWidth(int width){
        this.width = width;
    }

    @JsonIgnore
    public int getHeight(){
        return height;
    }

    public void setHeight(int height){
        this.height = height;
    }

    public String getServerIpaddress(){
        return serverIpaddress;
    }

    public void setServerIpaddress(String serverIpaddress){
        this.serverIpaddress = serverIpaddress;
    }

    public String getServerPort(){
        return serverPort;
    }

    public void setServerPort(String serverPort){
        this.serverPort = serverPort;
    }

    public String getWifiName(){
        return wifiName;
    }

    public void setWifiName(String wifiName){
        this.wifiName = wifiName;
    }

    public String getWifiPassword(){
        return wifiPassword;
    }

    public void setWifiPassword(String wifiPassword){
        this.wifiPassword = wifiPassword;
    }

	@JsonIgnore
    public Floor getFloor(){
        return floor;
    }

    public void setFloor(Floor floor){
        this.floor = floor;
    }

    public int getSleeplightlevel1(){
        return sleeplightlevel1;
    }

    public void setSleeplightlevel1(int sleeplightlevel1){
        this.sleeplightlevel1 = sleeplightlevel1;
    }

    public int getHangupthreshold1(){
        return hangupthreshold1;
    }

    public void setHangupthreshold1(int hangupthreshold1){
        this.hangupthreshold1 = hangupthreshold1;
    }

    public int getSleeplightlevel2(){
        return sleeplightlevel2;
    }

    public void setSleeplightlevel2(int sleeplightlevel2){
        this.sleeplightlevel2 = sleeplightlevel2;
    }

    public int getHangupthreshold2(){
        return hangupthreshold2;
    }

    public void setHangupthreshold2(int hangupthreshold2){
        this.hangupthreshold2 = hangupthreshold2;
    }

	
    public int getFullscreen(){
        return fullscreen;
    }

    public void setFullscreen(int fullscreen){
        this.fullscreen = fullscreen;
    }

	
    public int getTitledisplay(){
        return titledisplay;
    }

    public void setTitledisplay(int titledisplay){
        this.titledisplay = titledisplay;
    }

	
    public int getTimedisplay(){
        return timedisplay;
    }

    public void setTimedisplay(int timedisplay){
        this.timedisplay = timedisplay;
    }

	
    public int getSubtitledisplay(){
        return subtitledisplay;
    }

    public void setSubtitledisplay(int subtitledisplay){
        this.subtitledisplay = subtitledisplay;
    }

	@JsonIgnore
    public int getImageinterval(){
        return imageinterval;
    }

    public void setImageinterval(int imageinterval){
        this.imageinterval = imageinterval;
    }
    @JsonIgnore
   
    public String getDateformat(){
        return dateformat;
    }

    public void setDateformat(String dateformat){
        this.dateformat = dateformat;
    }
    @JsonProperty(value = "devicetime")
	public String getDevicetime() {
		return devicetime;
	}

	public void setDevicetime(String devicetime) {
		this.devicetime = devicetime;
	}


	@JsonIgnore
    public Date getStateDate() {
		return stateDate;
	}
	public void setStateDate(Date stateDate) {
		this.stateDate = stateDate;
	}

	@JsonIgnore
	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}
	@JsonIgnore
    public String getTimeformat(){
        return timeformat;
    }

    public void setTimeformat(String timeformat){
        this.timeformat = timeformat;
    }
    public String getResolution(){
        return width + "*" + height;
    }
	public void setResolution(String resolution){
        try{
            if(StringUtils.isNotEmpty(resolution)){
            	String tmp = resolution.toLowerCase();
                String[] resolutions = tmp.split("x");
                if(resolutions.length >= 2){
                    this.width = Integer.parseInt(resolutions[0].trim());
                    this.height = Integer.parseInt(resolutions[1].trim());
                }
            }
        }
        catch(Exception ignored){}
    }

	public String getMv(){
		return mv;
	}

	public void setMv(String mv){
		this.mv = mv;
	}

	public String getPv(){
		return pv;
	}

	public void setPv(String pv){
		this.pv = pv;
	}

	public String getSv(){
		return sv;
	}

	public void setSv(String sv){
		this.sv = sv;
	}
	@JsonIgnore
	@Length(min=0, max=1, message="is_publish长度必须介于 0 和 1 之间")
	public String getIsPublish() {
		return isPublish;
	}

	public void setIsPublish(String isPublish) {
		this.isPublish = isPublish;
	}

	public String getDelApproval(){
		return delApproval;
	}

	public EleEquipment setDelApproval(String delApproval){
		this.delApproval = delApproval;
		return this;
	}

	public String getShow() {
		return show;
	}

	public void setShow(String show) {
		this.show = show;
	}

	public String getSet() {
		return set;
	}

	public void setSet(String set) {
		this.set = set;
	}

	public String getMcu() {
		return mcu;
	}

	public void setMcu(String mcu) {
		this.mcu = mcu;
	}

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}
}